class Traversal{
	public Traversal(){
		
	}
	
	//Recursion, running time is O(n)
	public preorderTraversal(TreeNode root){
		if(root == null){
			return;
		}
		root.printValue();
		preorderTraversal(root.getLeft());
		preorderTraversal(root.getRight());
	}
	
	// Inorder traversal
	public inorderTraversal(TreeNode root){
		if(root == null) return;
		inorderTraversal(root.getLeft());
		root.printValue();
		inorderTraversal(root.getRight());		
	}
	
	// postoder traversal
	public postorderTraversal(TreeNode root){
		if(root == null) return;
		postorderTraversal(root.getLeft());
		postorderTraversal(root.getRight());
		root.printValue();
	}
	
	// Non-recursion
}